Viewport resolution scale parameter 2#759
Conversation
🦋 Changeset detectedLatest commit: 1d0d804 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Thanks for the PR!
We ran this through some QA and I have left a few comments about what we would like changed before we can merge this.
In addition to those suggestions below we would also like:
- The new setting to be exposed to the UI by modifying something like this (untested, please verify):
if (isSectionEnabled(settingsConfig, SettingsSections.UI)) {
/* Setup all view/ui related settings under this section */
const viewSettingsSection = this.buildSectionWithHeading(settingsElem, SettingsSections.UI);
if (isSettingEnabled(settingsConfig, Flags.MatchViewportResolution))
this.addSettingFlag(viewSettingsSection, this.flagsUi.get(Flags.MatchViewportResolution));
// Your new setting here
if (isSettingEnabled(settingsConfig, NumericParameters.ViewportResolutionScale))
this.addSettingNumeric(viewSettingsSection, NumericParameters.ViewportResolutionScale);
// ... Other view settings
}- A changeset added with accompanying long form change log entry, see: #759 (comment) for how to make a changset - When you make the changeset, it will be a minor change bump to both the library and UI library packages.
| 'Viewport Resolution Scale', | ||
| 'Scale factor for viewport resolution when MatchViewportResolution is enabled. 1.0 = 100%, 0.5 = 50%, 2.0 = 200%.', | ||
| 0.1 /*min*/, | ||
| 10.0 /*max*/, |
There was a problem hiding this comment.
We did some QA on this and we think 3x is a sane maximum. Values above that will commonly cause the encoder to fail as this will exceed the maximum encoding size on our H.264 settings - e.g. 4096x4096.
| 10.0 /*max*/, | |
| 3.0 /*max*/, |
| @@ -31,6 +31,7 @@ This page will be updated with new features and commands as they become availabl | |||
| | **Setting** | **Description** | | |||
| | --- | --- | | |||
| | **Match viewport resolution** | Resizes the Unreal Engine application resolution to match the browser's video element size.| | |||
There was a problem hiding this comment.
| | **Match viewport resolution** | Resizes the Unreal Engine application resolution to match the browser's video element size.| | |
| | **Match Viewport Resolution** | Resizes the Unreal Engine application resolution to match the browser's video element size. (Note: We recommend using `-windowed` on the UE side to allow scaling beyond monitor size.)| |
| | **Setting** | **Description** | | ||
| | --- | --- | | ||
| | **Match viewport resolution** | Resizes the Unreal Engine application resolution to match the browser's video element size.| | ||
| | **Viewport Resolution Scale** | Scale factor for viewport resolution when Match Viewport Resolution is enabled. Range: 0.1-10.0, Default: 1.0. Values above 1.0 (e.g., 1.5, 2.0) can improve visual quality on small screens by requesting higher resolution streams. | |
There was a problem hiding this comment.
| | **Viewport Resolution Scale** | Scale factor for viewport resolution when Match Viewport Resolution is enabled. Range: 0.1-10.0, Default: 1.0. Values above 1.0 (e.g., 1.5, 2.0) can improve visual quality on small screens by requesting higher resolution streams. | | |
| | **Viewport Resolution Scale** | Scale factor for viewport resolution when Match Viewport Resolution is enabled. Range: 0.1-3.0, Default: 1.0 (no scaling). Values above 1.0 (e.g., 1.5, 2.0) can improve visual quality on small screens by requesting higher resolution streams. | |
|
Hi @lukehb, |
|
Hey @christianstamati, You might have a bad local state. I was able to build this branch and run the signalling server by running |
…e constant
- Round scaled dimensions to integers before sending Resolution.Width /
Height commands to UE (non-integers were being JSON-stringified and
handed to cvar parsing).
- Warn via Logger when a scaled dimension exceeds the H.264 4096 limit so
large viewports with high scales surface a clear encoding-failure hint.
- Rename NumericParameters.ViewportResolutionScale -> ViewportResScale so
the TS constant matches the URL-param / persisted key ('ViewportResScale').
- Add Config.hasNumericSetting and fall back to 1.0 in VideoPlayer when
the setting is absent, so custom Config subclasses do not throw on
every resize.
- Add VideoPlayer Jest coverage for default, scaled, rounded, >4096-warn,
within-limit, missing-setting-fallback, and flag-disabled paths.
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
* Viewport resolution scale parameter 2 (#759) * Add ViewportResolutionScale configuration parameter * Add Docs for Viewport Resolution Scale in Frontend/Docs/Settings Panel.md * Address PR feedback: improve ViewportResolutionScale configuration * Harden ViewportResScale: round output, warn past encoder limit, rename constant - Round scaled dimensions to integers before sending Resolution.Width / Height commands to UE (non-integers were being JSON-stringified and handed to cvar parsing). - Warn via Logger when a scaled dimension exceeds the H.264 4096 limit so large viewports with high scales surface a clear encoding-failure hint. - Rename NumericParameters.ViewportResolutionScale -> ViewportResScale so the TS constant matches the URL-param / persisted key ('ViewportResScale'). - Add Config.hasNumericSetting and fall back to 1.0 in VideoPlayer when the setting is absent, so custom Config subclasses do not throw on every resize. - Add VideoPlayer Jest coverage for default, scaled, rounded, >4096-warn, within-limit, missing-setting-fallback, and flag-disabled paths. --------- Co-authored-by: Matthew.Cotton <matt@tensorworks.com.au> (cherry picked from commit 60da95c) # Conflicts: # Frontend/library/src/VideoPlayer/VideoPlayer.ts * fix: fixing ue version reference. --------- Co-authored-by: Christian Stamati <hello@chri.dev>
* Viewport resolution scale parameter 2 (#759) * Add ViewportResolutionScale configuration parameter * Add Docs for Viewport Resolution Scale in Frontend/Docs/Settings Panel.md * Address PR feedback: improve ViewportResolutionScale configuration * Harden ViewportResScale: round output, warn past encoder limit, rename constant - Round scaled dimensions to integers before sending Resolution.Width / Height commands to UE (non-integers were being JSON-stringified and handed to cvar parsing). - Warn via Logger when a scaled dimension exceeds the H.264 4096 limit so large viewports with high scales surface a clear encoding-failure hint. - Rename NumericParameters.ViewportResolutionScale -> ViewportResScale so the TS constant matches the URL-param / persisted key ('ViewportResScale'). - Add Config.hasNumericSetting and fall back to 1.0 in VideoPlayer when the setting is absent, so custom Config subclasses do not throw on every resize. - Add VideoPlayer Jest coverage for default, scaled, rounded, >4096-warn, within-limit, missing-setting-fallback, and flag-disabled paths. --------- Co-authored-by: Matthew.Cotton <matt@tensorworks.com.au> (cherry picked from commit 60da95c) # Conflicts: # Frontend/library/src/VideoPlayer/VideoPlayer.ts * fix: fixing ue version references. --------- Co-authored-by: Christian Stamati <hello@chri.dev>
* Add ViewportResolutionScale configuration parameter
* Add Docs for Viewport Resolution Scale in Frontend/Docs/Settings Panel.md
* Address PR feedback: improve ViewportResolutionScale configuration
* Harden ViewportResScale: round output, warn past encoder limit, rename constant
- Round scaled dimensions to integers before sending Resolution.Width /
Height commands to UE (non-integers were being JSON-stringified and
handed to cvar parsing).
- Warn via Logger when a scaled dimension exceeds the H.264 4096 limit so
large viewports with high scales surface a clear encoding-failure hint.
- Rename NumericParameters.ViewportResolutionScale -> ViewportResScale so
the TS constant matches the URL-param / persisted key ('ViewportResScale').
- Add Config.hasNumericSetting and fall back to 1.0 in VideoPlayer when
the setting is absent, so custom Config subclasses do not throw on
every resize.
- Add VideoPlayer Jest coverage for default, scaled, rounded, >4096-warn,
within-limit, missing-setting-fallback, and flag-disabled paths.
---------
(cherry picked from commit 60da95c)
Co-authored-by: Christian Stamati <hello@chri.dev>
Co-authored-by: Matthew.Cotton <matt@tensorworks.com.au>
Relevant components:
Problem statement:
When connecting from an iPhone or small screen device with MatchViewportRes set to true, the rendered resolution appears quite low, causing the visuals to look slightly pixelated.
More info here: #721
Solution
Added a new numeric parameter ViewportResolutionScale that multiplies the resolution dimensions sent to the onMatchViewportResolutionCallback when MatchViewportResolution is enabled. The scale factor is applied to both width and height in VideoPlayer.updateVideoStreamSize(), allowing users to request higher resolution streams (e.g., 1.5x or 2.0x) to improve visual quality on small screens.
Documentation
The new ViewportResolutionScale parameter is documented in Frontend/Docs/Settings Panel.md under the UI section.
Test Plan and Compatibility
Existing unit tests: Config.test.ts automatically covers the new parameter via the "should populate initial values for all settings" test (line 42-49), which validates all numeric parameters are registered